package eu.kuresson.tower.web;

import java.io.IOException;

import org.apache.wicket.protocol.ws.api.IWebSocketConnection;
import org.apache.wicket.protocol.ws.api.SimpleWebSocketConnectionRegistry;
import org.apache.wicket.protocol.ws.api.WebSocketBehavior;
import org.apache.wicket.protocol.ws.api.message.ClosedMessage;
import org.apache.wicket.protocol.ws.api.message.ConnectedMessage;
import org.apache.wicket.protocol.ws.api.message.TextMessage;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.WebSocketRequestHandler;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
import org.apache.wicket.markup.html.WebPage;
import eu.kuresson.tower.service.GamePlayService;

//@AuthorizeInstantiation("ROLE_SUPERVISOR")
public class HomePage extends WebPage {
	private static final long serialVersionUID = 1L;

	@SpringBean
	private GamePlayService gamePlayService;
	
	public HomePage() {

		gamePlayService.insertUser();
		
		// panel for guests
		add(new LoginPanel("loginPanel", this));
		add(new LoggedInPanel("loggedInPanel"));
		setOutputMarkupPlaceholderTag(true);
		
	}
}
